package com.cgwx.service;

import com.cgwx.data.dto.*;
import com.cgwx.entity.File;
import com.cgwx.entity.FileFolder;
import com.cgwx.entity.MinioFileVersion;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

@Service
public interface IUtilService {

    String viewFile(String account, String deptId, String entityId, String type);

    void download(UserInfo userInfo, List<FileFolder> fileFolders, String zipName, String id) throws JsonProcessingException;

    String updateParentTime(String entityId);

    @Transactional
    String uploadFile(String account, String name, String deptId, String roomId, String parentId, String type, MultipartFile multipartFile, String isOuter);

    @Transactional
    String insertNonProject(String account, String name, String roomId, String parentId, String fileUrl, String fileId, String fileName, String managerUserId, String managerUserName);

    @Transactional
    String updateFile(String ownerAccount, String ownerName, String entityName, String fileId, String fileUrl, String entityId, String versionId);

    List<MinioFileVersion> getVersionFile(String fileId);

    String addTags(String account, String deptId, String entityId, List<String> tags, String type);

    String getURLByFileId(String account, String deptId, String entityId, String type);

    @Transactional
    String restore(String account, String deptId, List<String> entityIds, String type);

    @Transactional
    String removeRecycleBin(String account, String deptId, String entityId, String parentId, String type);

    String rename(String account, String deptId, String entityName, String entityId, String parentId, String type);

    List<FileFolder> downloadFolder(String account, String deptId, String entityId, String type);

    String getFileLocalDateTime();

    @Transactional
    String delete(String account, String deptId, List<String> entityIds, String type);

    @Transactional
    String remove(String account, String deptId, String entityId, String parentId, String type);

    String getPathName(String entityId);

    boolean isDeptLeader(String userId);

    String getMethod(String url);

    String getMethod(String url, Map<String, String> map);

    List<NpjManageDto> sortNpjManageDto(List<NpjManageDto> npjManageDtos, String column, String sort);

    List<NpjReportDto> sortNpjReportDto(List<NpjReportDto> npjReportDtos, String column, String sort);

    List<NpjFileFolder> sortGlobal(List<NpjFileFolder> npjFileFolders, String column, String sort);

    List<NpjAtlasDto> sortNpjAtlasDto(List<NpjAtlasDto> npjAtlasDtos, String column, String sort);

    String getEntityNameByEntityId(String entityId);

    Map<String, String> jsonObjectToStringMap(com.alibaba.fastjson.JSONObject jsonObject);

    String getEntityIdByPath(String roomId, String path);
}
